[USER (data scientist)]: How can I fill the table with the head-to-head win-loss records? Please generate a DataFrame to update and display a head-to-head matrix, indicating wins among the top 10 ranked players on grass surfaces in the ATP tennis dataset.
My template of code snippet is:

---BEGIN CODE TEMPLATE---

import pandas as pd
import numpy as np
import pickle

atp_tennis = pd.read_csv('atp_tennis.csv')

# YOUR SOLUTION BEGIN:
<code1>
[COMPLETE YOUR CODE] 
</code1>
# YOUR SOLUTION END

print(head_to_head_matrix)

# save data
pickle.dump(head_to_head_matrix,open("./pred_result/head_to_head_matrix.pkl","wb"))

---END CODE TEMPLATE---

[YOU (AI assistant)]: Let me show you how to fill the table with the head-to-head records:
'''
import pandas as pd
import numpy as np
import pickle

atp_tennis = pd.read_csv('atp_tennis.csv')

# YOUR SOLUTION BEGIN:
